package com.cykj.pos.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.cykj.pos.mapper.PosBindActiveRecordsMapper;
import com.cykj.pos.domain.PosBindActiveRecords;
import com.cykj.pos.service.IPosBindActiveRecordsService;

import java.util.List;
import java.util.Map;

/**
 * 激活Service业务层处理
 *
 * @author weijianbo
 * @date 2025-01-23
 */
@Service
public class PosBindActiveRecordsServiceImpl extends ServiceImpl<PosBindActiveRecordsMapper, PosBindActiveRecords> implements IPosBindActiveRecordsService {

    @Override
    public List<PosBindActiveRecords> queryList(PosBindActiveRecords posBindActiveRecords) {
        LambdaQueryWrapper<PosBindActiveRecords> lqw = Wrappers.lambdaQuery();
        if (posBindActiveRecords.getMerchId() != null){
            lqw.eq(PosBindActiveRecords::getMerchId ,posBindActiveRecords.getMerchId());
        }
        if (StringUtils.isNotBlank(posBindActiveRecords.getMerchName())){
            lqw.like(PosBindActiveRecords::getMerchName ,posBindActiveRecords.getMerchName());
        }
        if (StringUtils.isNotBlank(posBindActiveRecords.getMerchantCode())){
            lqw.eq(PosBindActiveRecords::getMerchantCode ,posBindActiveRecords.getMerchantCode());
        }
        if (StringUtils.isNotBlank(posBindActiveRecords.getMerchantName())){
            lqw.like(PosBindActiveRecords::getMerchantName ,posBindActiveRecords.getMerchantName());
        }
        if (StringUtils.isNotBlank(posBindActiveRecords.getPosSn())){
            lqw.eq(PosBindActiveRecords::getPosSn ,posBindActiveRecords.getPosSn());
        }
        if (posBindActiveRecords.getBindTime() != null){
            lqw.eq(PosBindActiveRecords::getBindTime ,posBindActiveRecords.getBindTime());
        }
        if (StringUtils.isNotBlank(posBindActiveRecords.getActiveStatus())){
            lqw.eq(PosBindActiveRecords::getActiveStatus ,posBindActiveRecords.getActiveStatus());
        }
        if (posBindActiveRecords.getActiveTime() != null){
            lqw.eq(PosBindActiveRecords::getActiveTime ,posBindActiveRecords.getActiveTime());
        }
        if (posBindActiveRecords.getCashbackId() != null){
            lqw.eq(PosBindActiveRecords::getCashbackId ,posBindActiveRecords.getCashbackId());
        }
        if (posBindActiveRecords.getSecondSimTime() != null){
            lqw.eq(PosBindActiveRecords::getSecondSimTime ,posBindActiveRecords.getSecondSimTime());
        }
        if (posBindActiveRecords.getMerchUpFeeTime() != null){
            lqw.eq(PosBindActiveRecords::getMerchUpFeeTime ,posBindActiveRecords.getMerchUpFeeTime());
        }
        return this.list(lqw);
    }
}
